﻿Imports System.Data.SqlClient

Public Class frmProspectContacts

    Public SNo As Integer

    Private Sub frmProspectContacts_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Me.Cursor = Cursors.WaitCursor

            Dim cmd As New SqlCommand("Select * From ProspectContacts Where ProspID=" & SNo, cnn)
            Dim Reader As SqlDataReader

            Me.GridContactPersons.Rows.Clear()

            cnn.Open()
            Reader = cmd.ExecuteReader
            While Reader.Read
                Me.GridContactPersons.Rows.Add(New String() {Reader.Item("SNo"), Reader.Item("ContactName"), Reader.Item("Position"), _
                                                             Reader.Item("Email"), Reader.Item("Tele")})
            End While
            cnn.Close()

            Me.Cursor = Cursors.Default
        Catch ex As Exception
            Me.Cursor = Cursors.Default
            If cnn.State = ConnectionState.Open Then
                cnn.Close()
            End If
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class